from django.db import models


class BBS_user(models.Model): #user表
    username = models.CharField(max_length=24)  #用户
    password = models.CharField(max_length=128) #密码
#    md5pass = models.CharField(max_length=128)

    def __str__(self):
        return self.username


class BBS_post(models.Model): #文章帖子表
    title = models.CharField(max_length=64) #文章开头标题
    content = models.TextField() #文章内容
    author = models.ForeignKey(BBS_user) #作者
    created = models.DateTimeField(auto_now_add=True) #发表时间

    def __str__(self):
        return self.title


class BBS_comments(models.Model):
    com_name = models.CharField(max_length=24) #评论人
    com_post = models.ForeignKey(BBS_post) #评论帖子
    com_content = models.CharField(max_length=256) #评论内容
    con_created = models.DateTimeField(auto_now_add=True) #评论时间

    def __str__(self):
        return self.com_content


class BBS_the_lanel(models.Model):
    pass

